package com.group.library.order.controller.admin;


import com.group.library.order.dto.MessageBean;
import com.group.library.order.service.AdviceService;
import com.group.library.order.util.MessageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/advice")
public class AdviceManageController {

    @Autowired
    private AdviceService adviceService;

    @RequestMapping(value = "/listAdvice.action",method = RequestMethod.GET)
    public MessageBean findAdvice(Integer limit,Integer page,String name,String number){
        try{
            System.out.println("name-->"+name+" number-->"+number);
            return MessageUtil.success(adviceService.findAdvice(page, limit, name, number));
        } catch(Exception e){
            e.printStackTrace();
            return MessageUtil.failure("查找失败！");
        }
    }

}
